package lanQiaoBei.violent_recursion;
/*
*  使用暴力递归解决汉诺塔问题
* */
public class Hanota {
    public static void main(String[] args) {
           realize(10);
    }
    public static void realize(int n){
          fun(n,"左","中","右");
    }

    private static void fun(int i, String from, String to, String other) {
            if(i==1){
                System.out.println("move 1 from"+from+"to"+to);
                return;
            }
            fun(i-1,from,other,to);
            System.out.println("move"+i+from+"to"+to);
            fun(i-1,other,to,from);
    }
}
